

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using SubSonic.Utilities;
using JTC.MiniCommerce.Localization;

namespace JTC.MiniCommerce.Web.controls {
  public partial class search : System.Web.UI.UserControl {

    #region Page Events

    /// <summary>
    /// Handles the Load event of the Page control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
    protected void Page_Load(object sender, EventArgs e) {
      LocalizationUtility.AddButtonText(btnSearch);
    }

    /// <summary>
    /// Handles the Click event of the btnSearch control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
    protected void btnSearch_Click(object sender, EventArgs e) {
      if(!string.IsNullOrEmpty(txtSearchTerms.Text)) {
        Response.Redirect(string.Format("search.aspx?searchTerms={0}", HttpUtility.UrlEncode(txtSearchTerms.Text)));
      }
    }

    #endregion

  }
}